/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opgea.token.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.opgea.token.util.FacesUtil;

/**
 * 
 * @author Ramesh
 */
@Controller
@RequestMapping(value = "home")
public class HomeController {

    @RequestMapping(method = RequestMethod.GET)
    public String show(HttpServletRequest request) {
	if (FacesUtil.getSessionUserDataObject().getUserName() != null) {
	    return "home";
	} else {
	    return "login";
	}

    }

}
